<?
@ session_start();

include_once("class.lib/db.class.php");
include_once("class.lib/user.class.php");
include_once("class.lib/diplome.class.php");
include_once("class.lib/cours.class.php");
include_once("class.lib/domaine.class.php");
include_once("class.lib/mention.class.php");
include_once("class.lib/aa_niveau.class.php");
include_once("class.lib/aa_projet.class.php");

$cin=$_SESSION["cin"];
if($cin=="") { header("Location: ../index.php");   }

$unite = new Projet();
$details_unite = $unite->getProjetCode($_GET['id_ue']);
$_SESSION['code']=$_GET['id_ue'];


while (list($clef,$valeur)=each($details_unite))
{  

 $diplome    = $valeur["code_diplome"];
 
  $lib_unite    = $valeur["lib_unite"];
  
   $autre_domaine    = $valeur["autre_domaine"];
    $autre_mention    = $valeur["autre_mention"];
 
 //$diplome    = $valeur[8];
 $domaine    = $valeur[10];
 $mention    = $valeur[16];
 $specialite = $valeur[17];


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Modification de Projet</title>



<script language="JavaScript">
//PLF-http://www.jejavascript.net/
function OuvrirPop(url,nom,haut,Gauche,largeur,hauteur,options) {
ouvpop=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
}
</script>
<script type="text/javascript" src="javascript.js"></script>

<script src="scriptaculous/lib/prototype.js" type="text/javascript"></script>
<script src="scriptaculous/src/effects.js" type="text/javascript"></script>
<script type="text/javascript" src="fabtabulous.js"></script>
<script type="text/javascript" src="validation.js"></script>

<link href="presse.css" rel="stylesheet" type="text/css" />

</head>
<body >

<!--table width="677" height="575" border="0" cellpadding="0" cellspacing="0" align="center" >
    <tr>
    	<td-->
   
   	 <table align="center">
	 
	  <tr align="center"><td><img src="images/diploma.png"  width="72" height="72" /></td>
	 <td align="right"><H1><font color="DD0269">MODIFICATION DE DESCRIPTION DE LA FORMATION  PROJETEE</font></H1><br/></td>
	 </tr>
	</table>
	
<table width="90" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr> 
    
    <td><a href="modif_index.php?id_ue=<? echo $_GET['id_ue'];?>"><img src="images/etape1_off.jpg" width="90" height="20" border="0"/></a></td>
	<td><img src="images/etape2_on.jpg"   width="90" height="20" border="0"/></td>
   <!-- <td><a href="modif_indexation.php?id_ue=<?echo $_GET['id_ue'];?>"><img src="images/etape2_off.jpg"  width="90" height="20" border="0"/></a></td>
   -->
	<td><a href="modif_partenaire.php?id_ue=<? echo $_GET['id_ue'];?>"><img src="images/etape3_off.jpg" width="90" height="20" border="0"/></a></td>
    <td><a href="modif_equipe.php?id_ue=<? echo $_GET['id_ue'];?>"><img src="images/etape4_off.jpg" width="90" height="20" border="0"/></a></td>
	
  </tr>
</table>
<u>
<H1>&nbsp; </H1>
</u> 
<table width="481" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr> 
      <td width="481" align="left"> <p><strong><font color="DD0269">NB</font></strong>: Veuillez 
        v&eacute;rifier toutes les informations avant de valider le formulaire.<br />
       </p>
      </td>
    </tr>
    <tr> 
      
    <td align="left">&nbsp; </td>
    </tr>
    <tr>
      <td> 
        <table width="480" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr align="left"> 
          <td width="480" height="50"><em><font color="#277BB0"><strong> </strong></font></em> 
            <? if(!isset($_POST["valid_module"])) { ?>
            <form name="module" id="module" method="post" action="">
              <table width="109%" border="0" cellpadding="0" cellspacing="0" id="tab">
                <tr> 
                  <td height="13" colspan="3" align="left" class="titrebleu2">
				  <img src="images/Edit.png" />
				  <strong><img src="images/navi_arerow.gif" width="6" height="21" align="absmiddle" />Modification:</strong>
					
				  </td>
                </tr>
                <tr valign="top" bgcolor="#345491"> 
                  <td colspan="3"><img src="images/gif/pix.gif" width="1" height="1"></td>
                </tr>
                <tr> 
                  <td width="123" height="12" align="left" class="titrebleu2"><span class="Style5"><font color="DD0269">*</font></span> 
                   Niveau </td>
                  <td width="5" align="center">:</td>
                  <td width="370" align="left" class="required_info"> 
				  <select name="diplome" id="diplome" OnChange="sendData('id='+this.value,'domaine.php','domaine_liste');" onKeyUp="sendData('id='+this.value,'domaine.php','domaine_liste');" class="validate-selection" title="Veuillez selectionner un diplome SVP!">
                      <OPTION value="0">Niveau :</OPTION>
					
					 <?php 
		          $dipl  = new Niveau();
                  $diplm = $dipl->getAllNiveau();
				  // Liste des �tablissements
                 while (list($clef,$valeur)=each($diplm)) 
				     {  $vlr = strtr($valeur[1],'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ','AAAAAACEEEEIIIIOOOOOUUUUYaaaaaceeeeiiiioooooouuuuyyy');
						//echo "<OPTION value=$valeur[0]>$vlr</OPTION>";
						if($diplome == $valeur[0])  echo "<OPTION value=$valeur[0] selected=\"selected\">$valeur[1]</OPTION>";
							else                       echo "<OPTION value=$valeur[0]>$valeur[1]</OPTION>";
                     }
		        ?>



					
                  </select></td>
                </tr>
				
				<tr align="left"> 
                
				
				  <td width="123" height="12" align="left" class="titrebleu2"><span class="Style5"><font color="DD0269">*</font></span> 
                    Intitul&eacute; propos&eacute </td>
                  <td width="5" align="center">:</td>
                  <td width="370" align="left" class="required_info"> 
				  <!--<span class="Style5"><a href="#"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" onclick='OuvrirPop("ue.html","fencent",10,10,420,380,"menubar=no,scrollbars=no,statusbar=no")' /></a></span> -->
                   
                  <input name="unite_enseignement" type="text" id="unite_enseignement" class="required" value="<?php echo $lib_unite;?>" title="Veuillez entrer le titre SVP!!" /> 
                  </td>
                </tr>
				

                <tr> 
                  <td height="25" align="left"><span class="Style5"> <a href="#"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" onclick='OuvrirPop("domaine.html","fencent",10,10,420,380,"menubar=no,scrollbars=no,statusbar=no")' /></a> 
                    <font color="DD0269">*</font></span> Domaine </td>
                  <td height="25">:</td>
                  <td height="25" align="left" class="required_info" id="domaine_liste"> 
				  <select name="domaine" id="domaine" OnChange="sendData('id='+this.value,'mention.php','mention_liste');" onKeyUp="sendData('id='+this.value,'mention.php','mention_liste');" class="validate-selection" title="Veuillez selectionner un domaine SVP!">
                      <option value="0" selected="selected"> choisissez le domaine 
                      de formation</option>
                     <OPTION value="autre" <?php if($autre_domaine!='') echo "selected"  ?>>Autres</OPTION>
					 <?php 
		          $dom         = new Domaine();
                  $dom_details = $dom->getAllDomaine(0);
				  // Liste des etablissements
                 while (list($clef,$valeur)=each($dom_details)) 
				     { 
	
						if($domaine == $valeur[0]) echo "<OPTION value=$valeur[0] selected=\"selected\">$valeur[1]</OPTION>";
						else                       echo "<OPTION value=$valeur[0]>$valeur[1]</OPTION>";
                     }
		        ?>
					 
                    </select> </td>
                </tr>
				
								<tr align="left" id="autredomaine" name="autredomaine" style="display:'';"> 
                  <td width="242" height="12">
				  <!--<span class="Style5"><a href="#"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" onclick='OuvrirPop("ue.html","fencent",10,10,420,380,"menubar=no,scrollbars=no,statusbar=no")' /></a></span> -->
                    <span class="Style5"><font color="DD0269">*</font></span> 
                     Autre Domaine</td>
                  <td width="7" height="12">:</td>
                  <td width="231" height="12"  id="autredomaine_zone"> 
				  <input name="autre_domaine" type="text" id="autre_domaine" value="<?php echo $autre_domaine;?>" style="width:360px;"  title="Veuillez entrer le titre SVP!!" /> 
                  </td>
                </tr>
                <tr> 
                  <td height="25" align="left"><span class="Style5"> <a href="#"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" onclick='OuvrirPop("mention.html","fencent",10,10,420,380,"menubar=no,scrollbars=no,statusbar=no")' /></a> 
                    <font color="DD0269">*</font></span> Mention </td>
                  <td height="25">:</td>
                  <td height="25" align="left" id="mention_liste" class="required_info"> 
				  <select name="mention" id="mention" class="validate-selection" title="Veuillez selectionner la mention SVP!">
                      <option value="0" selected="selected"> choisissez la mention</option>
						<OPTION value="autre" <?php if($autre_mention!='') echo "selected"  ?>>Autres</OPTION>
			  <?php 
		          $men         = new Mention();
                  $men_details = $men->getAllMention(0);
				  
                 while (list($clef,$valeur)=each($men_details)) 
				     { 
	
						if($mention == $valeur[0]) echo "<OPTION value=$valeur[0] selected=\"selected\">$valeur[1]</OPTION>";
						else                       echo "<OPTION value=$valeur[0]>$valeur[1]</OPTION>";
                     }
		        ?>
	
			  
                    </select> </td>
                </tr>
				
					<tr align="left" id="autremention" name="autremention" style="display:'';"> 
                  <td width="242" height="12">
				  <!--<span class="Style5"><a href="#"><img src="images/info.gif" width="16" height="16" border="0" align="absmiddle" onclick='OuvrirPop("ue.html","fencent",10,10,420,380,"menubar=no,scrollbars=no,statusbar=no")' /></a></span> -->
                    <span class="Style5"><font color="DD0269">*</font></span> 
                     Autre Mention</td>
                  <td width="7" height="12">:</td>
                  <td width="231" height="12"  id="autremention_zone"> 
				  <input name="autre_mention" type="text" id="autre_mention" value="<?php echo $autre_mention;?>" style="width:360px;" title="Veuillez entrer la mention SVP!!" /> 
                  </td>
                </tr>

				
                <tr> 
                  <td height="25" align="left">
                  <input name="modif_unite" type="hidden" id="modif_unite" value="OK" />
				  <input name="id_ue" type="hidden" id="id_ue" value="<? echo $_GET['id_ue']; ?>" />
				  </td>
                  <td height="25">&nbsp;</td>
                  <td height="25" align="left"> <input type="reset" name="Submit22" value="R&eacute;tablir" class="button" /> 
                    <!--input type="submit" name="Submit31" value="Enregistrer" class="button" /-->
					<input type="submit" name="Submit3" value="valider" class="button" /> 
					
                  </td>
                </tr>
              </table>
            </form>
	  <script type="text/javascript">
		 var valid2 = new Validation('module', {useTitles:true});
	  </script>
		 <? } ?>      </td>
    </tr>
    <tr>
	
      
    <td align="left"><span class="Style5"><font color="DD0269">*</font></span> 
      <font color="DD0269"><em><strong>Champs obligatoire</strong></em></font></td>
    </tr>
  </table>
  </td>
    </tr>
</table>


<?
} // Fin liste modification
?>

<p> 
  <?
 if(!empty($_POST['modif_unite']))
{
	$ue_tab['diplome']    = $_POST["diplome"];
	$ue_tab['domaine']    = $_POST["domaine"];
	$ue_tab['mention']    = $_POST["mention"];
	$ue_tab['specialite'] = $_POST["specialite_cours"];
	
	$ue_tab['unite_enseignement'] = $_POST["lib_unite"];
	
	
	$ue_tab['code_ue'] = $_POST["id_ue"];
	
    $modif = $unite->updateDipInfos($ue_tab);
	//exit;
	
	//On actualise la page
	echo "<script language=\"JavaScript\"> document.location=\"modif_indexation.php?id_ue=".$_POST['id_ue']."\"; </script>;";
	} 

  
?>
</p>
</body>
</html>
